#ifndef _IUMACADDRESS_HPP_
#define _IUMACADDRESS_HPP_

#ifdef _SOLARIS_
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#include <sys/types.h>

class iuIPAddress;

/**
 * @brief Classe representant une adresse MAC
 */
class iuMacAddress
{
public:
   iuMacAddress();
   
   void set(uint8_t addr1, uint8_t addr2, uint8_t addr3, uint8_t addr4, uint8_t addr5, uint8_t addr6);
   void get(uint8_t *addr1, uint8_t *addr2, uint8_t *addr3, uint8_t *addr4, uint8_t *addr5, uint8_t *addr6) const;
   void build(const iuIPAddress &ip, pid_t pid, unsigned char interface);
   void setToBroadcast();
   
   bool operator==(const iuMacAddress &addr) const;
   bool isBroadcast() const;
   
   uint16_t fromBuffer(const char *buffer);
   uint16_t toBuffer(char *buffer) const;
   char *toString() const;
   
private:
   uint8_t m_address[6];
};

#endif
